package hypernexusclient

import (
	"github.com/TarsCloud/TarsGo/tars"
	"github.com/wzh200x/hyperNexus/hyperNexusProtocol/gdbServerProtocol"
)

type GdbServerClient struct {
	Proxy tars.ProxyPrx
}

func (c *GdbServerClient) Init(comm *tars.Communicator) error {
	cfg := tars.GetServerConfig()
	conf := tars.GetConf()
	objName := conf.GetStringWithDef("/tars/application<GDBServer>", cfg.App+"."+"GDBServer"+".DBOperateObj")
	c.Proxy = new(gdbServerProtocol.GDBServer)
	comm.StringToProxy(objName, c.Proxy)
	return nil
}

func (c *GdbServerClient) GetClientProxy() *gdbServerProtocol.GDBServer {
	return c.Proxy.(*gdbServerProtocol.GDBServer)
}

func NewGdbServerClient() *GdbServerClient {
	return &GdbServerClient{}
}
